<head>
<title>dsquared QR Code</title>

</head>
<body>
<?php

function qr_code ($url="http://www.dsq.co.uk", $width=320) {
    
if  ($url == "")   $url="http://www.dsq.co.uk";
    
echo "<h3>{$url}</h3>";
echo<<<STOP
<img src="https://chart.googleapis.com/chart?chs=320x320&cht=qr&chld=H&choe=UTF-8&chl={$url}"
 alt="QR code generation by dsquared" width="{$width}px" height="{$width}px" />
STOP;
}


if (isset($_REQUEST['url'])) qr_code ($_REQUEST['url'], $_REQUEST['width']);
else  qr_code();

?>

<form>
<fieldset>
<legend>Url:</legend>
<input name=url value="http://"></input>
</fieldset>
<fieldset>
<legend>Size</legend>
<input name=width></input>px (default 320x320px)
</fieldset>

<input type=submit value="Create QR Code"></input>


</form>
</body>
